package variationsSearch;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class DictionaryVariations {
	public static void main(String args[]) throws IOException{
		PrintStream ps = new PrintStream("J:\\BC3_IMT_Training\\PSIMI.txt");
		FileReader f=new FileReader("J:\\BC3_IMT_Training\\annotations\\allowed_PSI-MI_ids_and_synonyms.txt");
		BufferedReader fb = new BufferedReader(f);
		String s=fb.readLine();
		Pattern pattern;
		Matcher matcher;
		String t;
		String t2;
		while(s!=null){
			String term[] = s.split("\t");
			//term as it is
			
			ps.println(term[0]+"\t"+term[1]);

	
			//First letter capitalized
			pattern = Pattern.compile("^[^A-Z0-9]*");
			matcher=pattern.matcher(term[1]);
			
			if(matcher.matches()){
				t=term[1].substring(0, 1).toUpperCase()+term[1].substring(1);
				ps.println(term[0]+"\t"+t);
			}
			

			
			if(term[1].contains(" ")){
				System.out.println("hello");
				t=term[1].replaceAll(" ", "-");
				ps.println(term[0]+"\t"+t);
				t2=term[1].replaceFirst(" ", "-");
				if(!t.equals(t2))
					ps.println(term[0]+"\t"+t2);
					
			}
			
			if(term[1].contains("-")){
				t=term[1].replaceAll("-", " ");
				ps.println(term[0]+"\t"+t);
			}
			s=fb.readLine();
			
			
		}
	}
}
